/* MagicBento.css - Styles for the Magic Bento component */

/* Global spotlight styles */
.global-spotlight {
  position: fixed;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

/* Card grid layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 1rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card-grid .card {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  color: var(--card-text-color, white);
  isolation: isolate;
}

/* Card header and content */
.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.card__content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.card__description {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}

/* Card hover effects */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Border glow effect */
.card--border-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    rgba(var(--glow-color, 132, 0, 255), 0.3), 
    rgba(var(--glow-color, 132, 0, 255), 0.1), 
    rgba(var(--glow-color, 132, 0, 255), 0.3));
  border-radius: 18px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card--border-glow:hover::before {
  opacity: 1;
}

/* Text auto-hide effect */
.card--text-autohide .card__label,
.card--text-autohide .card__title,
.card--text-autohide .card__description {
  transition: opacity 0.3s ease;
}

.card--text-autohide:not(:hover) .card__label,
.card--text-autohide:not(:hover) .card__title,
.card--text-autohide:not(:hover) .card__description {
  opacity: 0.7;
}

.card--text-autohide:hover .card__label,
.card--text-autohide:hover .card__title,
.card--text-autohide:hover .card__description {
  opacity: 1;
}

/* Particle styles */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .card-grid .card {
    padding: 1rem;
  }
  
  .card__title {
    font-size: 1.25rem;
  }
  
  .card__description {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 160px;
  }
  
  .card__header {
    margin-bottom: 0.5rem;
  }
}

/* Card glow effect using CSS variables */
.card {
  --glow-x: 50%;
  --glow-y: 50%;
  --glow-intensity: 0;
  --glow-radius: 300px;
  --glow-color: 132, 0, 255;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  background: radial-gradient(
    var(--glow-radius) circle at var(--glow-x) var(--glow-y),
    rgba(var(--glow-color), calc(0.15 * var(--glow-intensity))),
    rgba(var(--glow-color), calc(0.05 * var(--glow-intensity))) 40%,
    transparent 70%
  );
  opacity: var(--glow-intensity);
  z-index: -1;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Ensure proper stacking context */
.particle-container {
  z-index: 10;
  position: relative;
}